package org.foj.service.impl;

import org.foj.dao.CommentDao;
import org.foj.model.Comment;
import org.foj.service.CommentManager;
//import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.security.annotation.Secured;

import java.util.List;
import javax.jws.WebService;

@WebService(serviceName = "CommentService", endpointInterface = "org.foj.service.CommentManager")

public class CommentManagerImpl implements CommentManager {

    private CommentDao commentDao;

    public CommentManagerImpl() {
    }

    public CommentManagerImpl(CommentDao commentDao) {
        this.commentDao = commentDao;
    }

    public List<Comment> findCommentsByIssueId(Long issueId) {
        return commentDao.getCommentsByIssueId(issueId);
    }


    public void deleteAllCommentsForIssueId(Long issueId) {
        commentDao.deleteAllCommentsForIssueId(issueId);
    }


    public Comment get(Long id) {
        return commentDao.get(id);
    }


    public Comment save(Comment comment) {
        return commentDao.save(comment);
    }


    public void remove(Long id) {
        commentDao.remove(id);
    }

}
